﻿<!--#include file="const.inc"-->

<%
	dim rs,sql,i,page

    		Page = Request("page")      '当前页数
    		If Page = "" Then Page = 1
   		If Not IsNumeric(Page) Then Page = 1
    		Page = CLng(Page)
    		If Page < 1 Then Page = 1
select case v
case "0"
we0="<br/>"
hr="--------------<br/>"
book="<input name='Page' format='*N' size='5' maxlength='5'/><anchor>跳页<go href='index.asp?id="&id&"&amp;sid="&sidd&"' method='post'><postfield name=""Page"" value=""$(Page:n)"" /></go></anchor><br/>"
%>
<card title="客服留言"><p align="<%=qingtian.px%>">
<%
case "1"
hr=""
zi="<span style=""color:#FF5500"">"
zi0="</span>"
we="<div class=""footer"">"
sou="<div class=""block4"">"
dao="<div class=""navi"">"
we0="</div>"
we1="</div>"
book="<form action=""index.asp?id="&id&"&amp;sid="&sidd&""" method=""post"">"&dao&"<input type=""text"" name=""Page"" value="""" format=""*N"" size=""5"" maxlength=""5""/><br/><input type=""submit"" value=""跳页"" /></form>"&we0&""
%>
<title>客服留言</title>
</head>
<body>
<%

End Select

		if sid="Null" then
		%><%=we%><%=zi%><%=qingtian.utf8(session("username"))%>欢迎你<%=zi0%><a href="/login.asp?sid=<%=sidd%>&amp;url=/liuy/index.asp?id=<%=id%>">注册/登陆</a><%=we0%><%
		else
		qingtian.info
		end if
Response.Write(""&dao&"<b><a href=""/index.asp?sid="&sidd&""">首页</a>&gt;<a href=""index.asp?sid="&sidd&""">留言首页</a>&gt;留言</b>"&we0&""&hr&"")
		%>
		<%=we%>
		<%


		Set Rs = Server.CreateObject("Adodb.Recordset")

		Sql = "select id,name,Reply,[time] from qingtian_ly  order by id desc"


		Rs.Open Sql,conn,1,1



		if not (rs.bof and rs.eof)  then
				Rs.PageSize = 15	'一页N条记录
				IF Not IsEmpty(Page) Then
					IF Not IsNumeric(Page) Then		'判断Page是否为数字
						Page=1
					Else
						Page=Cint(Page)		'转换成短整形Integer
					End IF
					IF Page > Rs.PageCount Then
						Rs.AbsolutePage = Rs.PageCount	'设置当前显示页等于最后一页
					ElseIF Page <= 0 Then
						Rs.AbsolutePage = 1		'设置当前页等于第一页
					Else
						Rs.AbsolutePage = Page	'如果大于零,显示当前页等于接收的页数
					End IF
				Else
					Rs.AbsolutePage = 1
				End IF
				Page = Rs.AbsolutePage


		For i=1 to  Rs.PageSize
		If Rs.Eof Then
			exit For
		End If
			%><a href="view.asp?id=<%=rs(0)%>&amp;sid=<%=sidd%>"><%=qingtian.utf8(rs(1))%></a><%if trim(rs("Reply"))<>"" then%>[已回]<%else%>[未回]<%end if%><br/><%
	 	Rs.MoveNext
	  	Next
       
    		'分页
    		If Page < rs.PageCount Then
    		    Response.Write("<a href='index.asp?page=" & Page + 1 & "&amp;sid="&sidd&"'>下一页</a>")
    		End If
       
    		If Page > 1 And Page < rs.PageCount Then
    		    Response.Write("|")
    		End If
        
    		If Page > 1 Then
    		    Response.Write("<a href='index.asp?page=" & Page - 1 & "&amp;sid="&sidd&"'>上一页</a><br/>")
    		Elseif rs.PageCount >1 then
    		    Response.Write("<br/>")
    		End If
                Response.Write we1
    		Randomize()
    
    		If rs.PageCount > 2 Then
%><%=book%><%=sou%><%
     		    Response.Write("[第"&Page&"/总"&rs.PageCount&"页/"&rs.RecordCount&"条]"&we0&"")
    		End If
                else
Response.Write("还没人在这发表过留言!"&we0&"")                
		end if
		Rs.close

			
		set rs=nothing

 		%>
<%=qingtian.qingsav("560")%><%=hr%>
<%=sou%><a href='add.asp?sid=<%=sidd%>'>发表新留言</a><%=we0%>
 
		<%


end Function
%>
